﻿using UnityEngine;
using System.Collections;

public class GameLogic : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	protected void Result(bool result)
	{
		Debug.Log (result.ToString ());
		try
		{
			GameObject.Find ("MiniGames").GetComponent<MiniGameSpawner> ().SpawnRandomMiniGame ();
		}
		catch
		{
			Debug.Log("Cannot spawn new mini game");
		}
		Destroy (this.gameObject);

	}
	protected virtual void TimerRanOut()
	{
		Result (false);
		Destroy (this.transform.parent.gameObject);
	}
	// Update is called once per frame
	void Update () {
	
	}
}
